package com.job.shuang.HomeWork0712;

import com.job.ZhangMeng.Homework0709.exNply.Legend;
import com.sun.org.apache.bcel.internal.generic.DDIV;

import java.util.Scanner;

/**
 * @author Liushuang
 * @version 1.0
 * @since 2022-07-12 20:48:13
 */
public class TestTiger{

    private static Object CanAttack;

    public static void main(String[] args) {
        Tiger tiger = new Tiger();
        while (true){
            tiger.setName("大狮子");
            if (tiger.setAttack()){
                tiger.setAttack((Attack) CanAttack);
            }else{
                Attack attack=new Attack(){//工厂策略

                    @Override
                    public void attackAction() {
                        System.out.println("老虎的默认攻击！");
                    }
                };
                attack.attackAction();
            }
        }
    }
}


